package com.lecyon.farm.vo.request;

import com.lecyon.farm.util.ValidateUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author Yao Zheng
 * @Date 2020/4/23 15:35
 */
@ApiModel(value = "墨卡托坐标数据")
@Data
public class Mercator {

    private BigDecimal lon;

    private BigDecimal lat;

    private String mercatorValue;

    public String getMercatorValue() {
        StringBuilder temp = new StringBuilder();
        if (ValidateUtils.isNotNullOrEmpty(lon) && ValidateUtils.isNotNullOrEmpty(lat)) {
            temp.append("[").append(lon).append(",").append(lat).append("]");
        }
        mercatorValue = temp.toString();
        return mercatorValue;
    }

}
